#ifndef RATEMANAGEMENT_H_
#define RATEMANAGEMENT_H_

#include "PackageUtils.h"

namespace Impp
{

enum RateState{
	RATE_CLEAR = 0,
	RATE_ALERT = 1,
	RATE_LIMITED =2
};

class RateManagement
{
private:
	std::vector<Rate> rates;
	std::vector<RateGroup> rateGroups;
	
public:
	RateManagement();
	virtual ~RateManagement();
	
	void setRates(std::vector<Rate> & rates, std::vector<RateGroup> & rateGroups);
	Rate* getRateByFamilyPair(byte* familyPairData);
	dword calculateNextLevel(Rate* rate, bool update = false);
	RateState getRateState(Rate* rate, dword level);
	void clearRates();
	

private:
	dword getFamilyPairDword(byte* familyPairData);
	Rate* getRate(dword familyPair);
	
};

}

#endif /*RATEMANAGEMENT_H_*/
